#include "stdafx.h"
#include "Renderer.h"
#include "CXComp.h"
#include <MyControls/AsyncCall.h>

Renderer::Renderer(CXComp & Comp) : 
	mswin::thread(false), //don't create a thread before request
	m_Comp(Comp)
{ 
	++m_Comp.m_NumRenderings;
} 

Renderer::~Renderer()
{
	--m_Comp.m_NumRenderings;
}

void Renderer::report_error(const char * msg)
{
	AfxMessageBox(msg, MB_OK | MB_ICONEXCLAMATION);
}

AsyncDeleteRenderer::~AsyncDeleteRenderer()
{
	My::AsyncDelete(m_pRenderer);
}
